﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmCRUDArea.aspx.cs" Inherits="SISLOG.Web.frmCRUDArea" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<fieldset>
<legend><asp:Label id="LabelTitulo" runat="server"></asp:Label></legend>
 
    <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSourceArea" 
        DefaultMode="Edit" oniteminserted="FormView1_ItemInserted" 
        onitemupdated="FormView1_ItemUpdated">
 <EditItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        Id Area:</td>
                    <td>
                        <asp:TextBox ID="IdAreaTextBox" runat="server" Height="20px" 
                            Text='<%# Bind("IdArea") %>' Width="164px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nombre Area:</td>
                    <td>
                        <asp:TextBox ID="NombreAreaTextBox" runat="server" 
                            Text='<%# Bind("NombreArea") %>' Height="19px" Width="164px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Actualizar" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancelar" PostBackUrl="~/frmArea.aspx" />
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <InsertItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        Id Area:</td>
                    <td>
                        <asp:TextBox ID="IdAreaTextBox" runat="server" Height="20px" 
                            Text='<%# Bind("IdArea") %>' Width="164px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nombre Area:</td>
                    <td>
                        <asp:TextBox ID="NombreAreaTextBox" runat="server" 
                            Text='<%# Bind("NombreArea") %>' Width="164px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="Insertar" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                        <asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancelar" 
                            PostBackUrl="~/frmArea.aspx" />
                    </td>
                </tr>
            </table>
        </InsertItemTemplate>
        <ItemTemplate>
            IdArea:
            <asp:Label ID="IdAreaLabel" runat="server" Text='<%# Bind("IdArea") %>' />
            <br />
            NombreArea:
            <asp:Label ID="NombreAreaLabel" runat="server" 
                Text='<%# Bind("NombreArea") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Editar" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="Nuevo" />
        </ItemTemplate>
    </asp:FormView>
    </fieldset>
    <asp:ObjectDataSource ID="ObjectDataSourceArea" runat="server" 
        DataObjectTypeName="SISLOG.BusinessEntities.Area" InsertMethod="RegistrarArea" 
        onobjectcreating="ObjectDataSourceArea_ObjectCreating" 
        SelectMethod="GetAllFromAreaByIdArea" TypeName="SISLOG.BusinessLogic.AreaBL" 
        UpdateMethod="RegistrarArea">
        <SelectParameters>
            <asp:QueryStringParameter Name="idArea" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
